local hx__doro_kill = fk.CreateSkill {
  name = "hx__doro_kill",
  tags = { Skill.Compulsory, Skill.Permanent },
}

Fk:loadTranslationTable{
  ["hx__doro_kill"] = "神临",
  [":hx__doro_kill"] = "持恒技，锁定技，其他角色不能响应你使用的牌。出牌阶段限共限8次，你可以将一名角色的体力值护甲和及体力上限调整至1点或对一名角色造成共计3点各类型伤害且其失去1点体力。",
  ["#hx__doro_kill_hp"] = "将该角色的体力值护甲和及体力上限调整至1点",
  ["#hx__doro_kill_damage"] = "对该角色造成共计3点各类型伤害且其失去1点体力",
}

hx__doro_kill:addEffect("active", {
  name = "hx__doro_kill",
  anim_type = "offensive",
  card_num = 0,
  target_num = 1,
  prompt = "出牌阶段限共限8次，将一名角色的体力值及体力上限调整至1点或对一名角色造成共计3点各类型伤害且其失去1点体力",
  can_use = function(self, player)
    return player:usedEffectTimes(self.name, Player.HistoryPhase) < 8 and player:hasSkill(hx__doro_kill.name)
  end,
  target_filter = function(self, player, to_select, selected, selected_cards)
    return #selected == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local to = effect.tos[1]
    local chosen = room:askToChoice(player, {
      choices = {"#hx__doro_kill_hp", "#hx__doro_kill_damage" },
      skill_name = hx__doro_kill.name,
      cancelable = false,
    })
    if chosen == "#hx__doro_kill_damage" then
      room:loseHp(to, 1, hx__doro_kill.name)
      room:damage({
        from = player,
        to = to,
        damage = 1,
        skillName = hx__doro_kill.name,
      })
      room:damage({
        from = player,
        to = to,
        damage = 1,
        damageType = fk.ThunderDamage,
        skillName = hx__doro_kill.name,
      })
      room:damage({
        from = player,
        to = to,
        damage = 1,
        damageType = fk.FireDamage,
        skillName = hx__doro_kill.name,
      })
    else
      room:setPlayerProperty(to, "hp", 1)
      room:setPlayerProperty(to, "shield", 1)
      room:setPlayerProperty(to, "maxHp", 1)
    end
  end,
})

hx__doro_kill:addEffect(fk.CardUsing, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(hx__doro_kill.name)
  end,
  on_use = function(self, event, target, player, data)
    data.disresponsiveList = data.disresponsiveList or {}
    for _, p in ipairs(player.room:getOtherPlayers(player, false)) do
      table.insertIfNeed(data.disresponsiveList, p)
    end
  end,
})



return hx__doro_kill